package games.car;
import java.awt.*;

public class Boom {
	private int x,y;
	private boolean live = true;
	private int[] diameter = {4,5,7,9,12,14,17,20,23,25,28,33,34,36,38,41,41,36,34,30,28,18,16,8,5};
	private int step = 0;
	
	public Boom(int x, int y){
		this.x = x;
		this.y = y;
	}
	
	protected void draw(Graphics g){
		if(!live) return;
		if(step == diameter.length){
			live = false;
			step = 0;
			return;
		}
		Color c = g.getColor();
		g.setColor(Color.orange);
		g.fillOval(x+15-(diameter[step]/2), y+15-(diameter[step]/2), diameter[step], diameter[step]);
		g.setColor(c);
		step++;
	}

}
